from pynput.keyboard import Key, Controller
import time
from pynput import mouse
from pynput.mouse import Button

keyboard = Controller()
mc = mouse.Controller()

keyboard.press(Key.cmd)
keyboard.release(Key.cmd)
time.sleep(0.5)

for i in 'shub':
    keyboard.press(i)
    keyboard.release(i)
time.sleep(0.5)
mc.position = (128, 216)
time.sleep(0.5)
mc.click(Button.left, 1)
time.sleep(2)

with keyboard.pressed(Key.cmd):
    keyboard.press(Key.up)
    keyboard.release(Key.up)
time.sleep(0.5)
mc.position = (1143,175)
time.sleep(0.5)
mc.click(Button.left, 1)
time.sleep(1.5)

with keyboard.pressed(Key.alt):
    keyboard.press(Key.f4)
    keyboard.release(Key.f4)
time.sleep(0.5)
mc.click(Button.left, 1)
time.sleep(1)
for i in range(5):
    keyboard.press(Key.tab)
    keyboard.release(Key.tab)
    time.sleep(0.2)
keyboard.press(Key.right)
time.sleep(0.1)
keyboard.release(Key.right)
with keyboard.pressed(Key.alt):
    keyboard.press('s')
    keyboard.release('s')

time.sleep(0.2)

for i in range(3):
    keyboard.press(Key.up)
    keyboard.release(Key.up)
    time.sleep(0.2)
if __name__ == '__main__':    
    with keyboard.pressed(Key.alt):
        keyboard.press('a')
        keyboard.release('a')
    